<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>待核查</title>
    <!-- import CSS -->
    <link rel="stylesheet" href="./static/elementui.css">
</head>

<body>
    <div id="app">
        <el-row type="flex" justify="center">
            <el-col :span="3"></el-col>
            <el-col :span="18">
                <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal"
                    background-color="#545c64" text-color="#fff" active-text-color="#ffd04b">
                    <el-menu-item index="1" @click="changeTab(1)">残疾人列表</el-menu-item>
                    <el-menu-item index="2" @click="changeTab(2)">待核验</el-menu-item>
                    <!-- <el-menu-item index="3" @click="changeTab(3)">验证码错误</el-menu-item> -->
                    <el-menu-item index="4" @click="changeTab(4)">数据统计</el-menu-item>
                </el-menu>

                <el-row type="flex" style="padding-top:10px;width: 100%;">
                    <el-form ref="form" :inline="true" :model="form" label-width="auto" style="width: 100%;">
                        <el-divider content-position="left">目标执行表</el-divider>
                        <el-form-item label="浆站表">
                            <el-input v-model="form.nat.station_code" style="width: 200px;">donor_check_3701</el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="onSubmit">保存</el-button>
                        </el-form-item>
                        <br>

                        <el-divider content-position="left">执行</el-divider>
                        <el-form-item label="执行条数">
                            <el-input v-model="form.pop.num" style="width: 200px;"></el-input>
                        </el-form-item>
                        <br>

                        <br>

                        <el-form-item style="position: absolute;right:0;margin-top:40px">

                        </el-form-item>
                    </el-form>
                </el-row>

            </el-col>
            <el-col :span="3">
                
            </el-col>
        </el-row>
        <div>
              <el-row>
                  <el-button type="primary" @click="onDo" style="margin-top:40px">执行</el-button>
              </el-row>
              <el-row>
                <el-button type="primary" @click="onDoSys" style="margin-top:80px" >系统繁忙</el-button>
            </el-row>
            <el-row>
                <el-button type="primary" @click="onDoAgain" style="margin-top:40px">执行验证码错误</el-button>
            </el-row>
        </div>
        
    </div>

    <!-- import Vue before Element -->
    <script src="./static/vue.min.js"></script>
    <!-- import JavaScript -->
    <script src="./static/elementui.js"></script>
    <!-- import axios -->
    <script src="./static/axios.min.js"></script>
    <!-- import cookie -->
    <script src="./static/js.cookie.min.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: function () {
                return {
                    form: {
                        nat: {
                            station_code: '3701',

                        },
                        pop: {
                            num: '10',

                        }
                    },
                    activeIndex2: '2',
                    activeNames: ['1', '2']
                }
            },
            created() {
                if (Cookies.get('login') != 'true') {
                    window.location.href = './login.html'
                } else {
                    this.getSetting()
                }
            },
            methods: {
                changeTab(type) {
                    if (type == 2) {
                        window.location.href = "./uncheck.html"
                    } else if (type == 3) {
                        window.location.href = "./index.html"
                    } else if (type == 4) {
                        window.location.href = "./count.html"
                    } else {
                        window.location.href = "./index.html"
                    }
                },
                getSetting() {
                    axios.get('/get_setting').then((res) => {
                        data = res.data
                        this.form.nat.station_code = data['data']
                    })
                },
                onSubmit() {
                    axios.post('/set_setting', {
                        setting: this.form
                    }).then((res) => {
                        data = res.data
                        if (data.code == 1) {
                            this.$message({ message: '保存成功！', type: 'success' })
                        } else {
                            this.$message({ message: '保存失败！', type: 'error' })
                        }
                    })
                },
                onDo() {
                    window.location.href = "./check?num=" + this.form.pop.num
                },
                onDoAgain() {
                    window.location.href = "./checkAgain?num=" + this.form.pop.num
                },
                 onDoSys() {
                    window.location.href = "./checkSysError?num=" + this.form.pop.num
                }
            }
        })
    </script>
</body>

</html>